<?
class ValidatorException extends Exception {
	private $validator,$value;
	
	public function __construct(Validator $validator,$value) {
		$this->validator= $validator;
		$this->value= $value;
	}
	public function getErrorMessage() {
		return sprintf($this->validator->getErrorMessage(),$this->value);
	}
	public function getValidator() {
		return $this->validator;
	}
	public function getValue() {
		return $this->value;
	}
	public function __toString() {
		return $this->getErrorMessage();
	}
}